package com.stable.job;

import org.springframework.stereotype.Component;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;

import lombok.extern.log4j.Log4j2;

/**
 * 这是我们的测试job类
 * 
 * @author
 * @date 2018/10/25.
 */
@Component
@Log4j2
public class TestJob implements SimpleJob {

	@Override
	public void execute(ShardingContext sc) {
		log.info("我是一个定时任务:{},{},{},{},{},{},", sc.getJobName(), sc.getJobParameter(), sc.getShardingParameter(),
				sc.getShardingTotalCount(), sc.getTaskId(),sc.getShardingItem());
	}

	public static void main(String[] args) {
		double x = 2.4809;

		double last1Roe = 23.55;double last2Roe = 23.9;double last3Roe = 15.62;double last4Roe = 15.99;double last5Roe = 20.85;
		double fiveYearAvgRoe = (1+last1Roe/100) * (1+last2Roe/100) * (1+last3Roe/100) * (1+last4Roe/100) * (1+last5Roe/100);
		System.out.println((Math.pow(fiveYearAvgRoe, 0.2)-1) * 100);

		double last1Ys = 20.6216;double last2Ys = 41.5823;double last3Ys = 31.0252;
		double threeYearYs = (1 + last1Ys / 100) * (1 + last2Ys / 100) * (1 + last3Ys / 100) * 100 - 100; // 过去3年营收增速
		System.out.println(threeYearYs);
	}
}
